package com.ct.mybatis.mapper;

import com.ct.mybatis.model.ArticleInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ArticleMapper {
    @Select("select * from article_info where id = #{article}")
    ArticleInfo selectById(Integer articleId);

    @Select("select ta.*, tb.username, tb.age, tb.gender" +
            " from article_info ta" +
            " left join user_info tb on ta.uid = tb.id" +
            " where ta.id = #{id}")
    ArticleInfo selectById2(Integer articleId);
}
